home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 2010 April
/
PCWorld0410.iso
/
redakcyjne
/
programy
/
Weather Watcher Live 6.1.23
/
WWL6123.exe
/
{app}
/
Skins
/
Interface
/
Splendid2
/
Includes
/
Lightbox.js
< prev
next >
Wrap
Text File
|
2009-12-26
|
12KB
|
275 lines
var browserWindowWidth = 0;
var browserWindowHeight = 0;
function showSettings()
{ document.getElementById("WW-SettingsOverlay").style.display = '';
//***********************************
//* Set "Bar Graphs" radio button *
//***********************************
switch (document.getElementById("WW-SkinOption7").innerHTML)
{ case "Hide": document.SplendidOptionsForm[1].checked = true; break;
default: document.SplendidOptionsForm[0].checked = true; break;
}
//*****************************
//* Set "Map Link" text box *
//*****************************
document.SplendidOptionsForm[2].value = document.getElementById("WW-SkinOption20").innerHTML;
//***************************************
//* Set "Map Zoom Level" radio button *
//***************************************
switch (document.getElementById("WW-SkinOption6").innerHTML)
{ case "1": document.SplendidOptionsForm[3].checked = true; break;
case "2": document.SplendidOptionsForm[4].checked = true; break;
case "5": document.SplendidOptionsForm[5].checked = true; break;
case "6": document.SplendidOptionsForm[6].checked = true; break;
case "7": document.SplendidOptionsForm[7].checked = true; break;
default: document.SplendidOptionsForm[4].checked = true; break;
}
//*********************************
//* Set "News Bar" radio button *
//*********************************
switch (document.getElementById("WW-SkinOption4").innerHTML)
{ case "Hide": document.SplendidOptionsForm[9].checked = true; break;
default: document.SplendidOptionsForm[8].checked = true; break;
}
//***************************************
//* Set "Slider Display" radio button *
//***************************************
switch (document.getElementById("WW-SkinOption2").innerHTML)
{ case "Days": document.SplendidOptionsForm[10].checked = true; break;
case "Moons": document.SplendidOptionsForm[12].checked = true; break;
default:
switch (document.getElementById("WW-IsInternational").innerHTML)
{ case "False": document.SplendidOptionsForm[11].checked = true; break;
default: document.SplendidOptionsForm[10].checked = true; break;
}
break;
}
//******************************************
//* Set "Thermometer Color" radio button *
//******************************************
switch (document.getElementById("WW-SkinOption1").innerHTML)
{ case "Blue": document.SplendidOptionsForm[13].checked = true; break;
case "BlueRed": document.SplendidOptionsForm[15].checked = true; break;
case "RedBlue": document.SplendidOptionsForm[16].checked = true; break;
default: document.SplendidOptionsForm[14].checked = true; break;
}
//*****************************************
//* Set "Wind Gauge Arrow" radio button *
//*****************************************
switch (document.getElementById("WW-SkinOption3").innerHTML)
{ case "Reverse": document.SplendidOptionsForm[18].checked = true; break;
default: document.SplendidOptionsForm[17].checked = true; break;
}
GetBrowserWindowSize();
document.getElementById("WW-Settings").style.display = "";
document.getElementById("WW-Settings").style.left = (browserWindowWidth - document.getElementById("WW-Settings").offsetWidth) / 2 + "px";
document.getElementById("WW-Settings").style.top = (browserWindowHeight - document.getElementById("WW-Settings").offsetHeight) / 2 + "px";
}
function hideSettings()
{ document.getElementById("WW-Settings").style.display = "none";
document.getElementById("WW-SettingsOverlay").style.display = "none";
//***********************
//* Save "Bar Graphs" *
//***********************
try
{ if (document.SplendidOptionsForm[0].checked == true)
{ if (document.getElementById("WW-SkinOption7").innerHTML != "Show")
{ document.getElementById("WW-SkinOption7").innerHTML = "Show";
document.getElementById("WW-Graphs").style.display = "";
}
}
else if (document.SplendidOptionsForm[1].checked == true)
{ if (document.getElementById("WW-SkinOption7").innerHTML != "Hide")
{ document.getElementById("WW-SkinOption7").innerHTML = "Hide";
document.getElementById("WW-Graphs").style.display = "none";
}
}
}
catch(err){}
//******************************
//* Save "Map Link" text box *
//******************************
var strMapLink = document.SplendidOptionsForm[2].value;
var strMapLinkExtension = right(strMapLink, 3).toLowerCase();
if (strMapLinkExtension == "gif" || strMapLinkExtension == "jpg" || strMapLinkExtension == "png")
{ document.getElementById("WW-SkinOption20").innerHTML = document.SplendidOptionsForm[2].value;
}
else
{ document.getElementById("WW-SkinOption20").innerHTML = "";
}
//*************************
//* Save map zoom level *
//*************************
try
{ if (document.SplendidOptionsForm[3].checked == true)
{ document.getElementById("WW-SkinOption6").innerHTML = "1";
}
else if (document.SplendidOptionsForm[4].checked == true)
{ document.getElementById("WW-SkinOption6").innerHTML = "2";
}
else if (document.SplendidOptionsForm[5].checked == true)
{ document.getElementById("WW-SkinOption6").innerHTML = "5";
}
else if (document.SplendidOptionsForm[6].checked == true)
{ document.getElementById("WW-SkinOption6").innerHTML = "6";
}
else if (document.SplendidOptionsForm[7].checked == true)
{ document.getElementById("WW-SkinOption6").innerHTML = "7";
}
}
catch(err){}
//***************************
//* Save news bar display *
//***************************
try
{ if (document.SplendidOptionsForm[8].checked == true)
{ if (document.getElementById("WW-SkinOption4").innerHTML != "Show")
{ document.getElementById("WW-SkinOption4").innerHTML = "Show";
document.getElementById("WW-News-Bar-Top").style.display = "";
}
}
else if (document.SplendidOptionsForm[9].checked == true)
{ if (document.getElementById("WW-SkinOption4").innerHTML != "Hide")
{ document.getElementById("WW-SkinOption4").innerHTML = "Hide";
document.getElementById("WW-News-Bar-Top").style.display = "none";
}
}
}
catch(err){}
//*************************
//* Save slider display *
//*************************
try
{ if (document.SplendidOptionsForm[10].checked == true)
{ if (document.getElementById("WW-SkinOption2").innerHTML != "Days")
{ document.getElementById("SliderDIV").style.left = "32px";
document.getElementById("WW-SkinOption2").innerHTML = "Days";
document.getElementById("WW-Day-Slider").style.display = "";
document.getElementById("WW-Hour-Slider").style.display = "none";
document.getElementById("WW-Moon-Slider").style.display = "none";
}
}
else if (document.SplendidOptionsForm[11].checked == true)
{ if (document.getElementById("WW-SkinOption2").innerHTML != "Hours")
{ document.getElementById("SliderDIV").style.left = "32px";
document.getElementById("WW-SkinOption2").innerHTML = "Hours";
document.getElementById("WW-Hour-Slider").style.display = "";
document.getElementById("WW-Day-Slider").style.display = "none";
document.getElementById("WW-Moon-Slider").style.display = "none";
}
}
else if (document.SplendidOptionsForm[12].checked == true)
{ if (document.getElementById("WW-SkinOption2").innerHTML != "Moons")
{ document.getElementById("SliderDIV").style.left = "32px";
document.getElementById("WW-SkinOption2").innerHTML = "Moons";
document.getElementById("WW-Moon-Slider").style.display = "";
document.getElementById("WW-Day-Slider").style.display = "none";
document.getElementById("WW-Hour-Slider").style.display = "none";
}
}
}
catch(err){}
//****************************
//* Save thermometer color *
//****************************
try
{ if (document.SplendidOptionsForm[13].checked == true)
{ if (document.getElementById("WW-SkinOption1").innerHTML != "Blue")
{ document.getElementById("WW-SkinOption1").innerHTML = "Blue";
document.getElementById("WW-Thermometer-Bulb").src = "../../Images/ThermBulbBlue.png";
document.getElementById("WW-Thermometer-Fill").style.background = "url('../../Images/ThermTopBlue.png')";
}
}
else if (document.SplendidOptionsForm[14].checked == true)
{ if (document.getElementById("WW-SkinOption1").innerHTML != "Red")
{ document.getElementById("WW-SkinOption1").innerHTML = "Red";
document.getElementById("WW-Thermometer-Bulb").src = "../../Images/ThermBulbRed.png";
document.getElementById("WW-Thermometer-Fill").style.background = "url('../../Images/ThermTopRed.png')";
}
}
else if (document.SplendidOptionsForm[15].checked == true)
{ if (document.getElementById("WW-SkinOption1").innerHTML != "BlueRed")
{ document.getElementById("WW-SkinOption1").innerHTML = "BlueRed";
if (parseInt(plainTemp) < 33)
{ document.getElementById("WW-Thermometer-Bulb").src = "../../Images/ThermBulbBlue.png";
document.getElementById("WW-Thermometer-Fill").style.background = "url('../../Images/ThermTopBlue.png')";
}
else
{ document.getElementById("WW-Thermometer-Bulb").src = "../../Images/ThermBulbRed.png";
document.getElementById("WW-Thermometer-Fill").style.background = "url('../../Images/ThermTopRed.png')";
}
}
}
else if (document.SplendidOptionsForm[16].checked == true)
{ if (document.getElementById("WW-SkinOption1").innerHTML != "RedBlue")
{ document.getElementById("WW-SkinOption1").innerHTML = "RedBlue";
if (parseInt(plainTemp) < 33)
{ document.getElementById("WW-Thermometer-Bulb").src = "../../Images/ThermBulbRed.png";
document.getElementById("WW-Thermometer-Fill").style.background = "url('../../Images/ThermTopRed.png')";
}
else
{ document.getElementById("WW-Thermometer-Bulb").src = "../../Images/ThermBulbBlue.png";
document.getElementById("WW-Thermometer-Fill").style.background = "url('../../Images/ThermTopBlue.png')";
}
}
}
}
catch(err){}
//***************************
//* Save wind gauge arrow *
//***************************
try
{ if (document.SplendidOptionsForm[17].checked == true)
{ if (document.getElementById("WW-SkinOption3").innerHTML != "Standard")
{ document.getElementById("WW-SkinOption3").innerHTML = "Standard";
windArrowDirection = "S";
}
}
else if (document.SplendidOptionsForm[18].checked == true)
{ if (document.getElementById("WW-SkinOption3").innerHTML != "Reverse")
{ document.getElementById("WW-SkinOption3").innerHTML = "Reverse";
windArrowDirection = "R";
}
}
}
catch(err){}
}
function GetBrowserWindowSize()
{ if (typeof( window.innerWidth ) == "number") //Non-IE
{ browserWindowWidth = window.innerWidth;
browserWindowHeight = window.innerHeight;
}
else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) //IE 6+ in 'standards compliant mode'
{ browserWindowWidth = document.documentElement.clientWidth;
browserWindowHeight = document.documentElement.clientHeight;
}
else if (document.body && (document.body.clientWidth || document.body.clientHeight)) //IE 4 compatible
{ browserWindowWidth = document.body.clientWidth;
browserWindowHeight = document.body.clientHeight;
}
}